package com.peng.egmvc1.mapper;

import com.peng.egmvc1.pojo.entity.Emp;
import com.peng.egmvc1.pojo.vo.EmpVO;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

/**
 * 员工Mapper
 * @Author peng
 * @Date 2024-04-22 19:57
 */
public interface EmpMapper {
    @Insert("insert into emp(id, title, salary, job) " +
            "values (#{id}, #{title}, #{salary}, #{job})")
    int addEmp(Emp emp);

    @Select("select title,job from emp")
    List<EmpVO> selectAllEmp();

    int updateEmp(Emp emp);

    @Delete("delete from emp where id = #{id}")
    int deleteEmp(Integer id);
}
